<?php
class Zendvn_Xml{
	
	/*  
	 * @param: name file.
	 * Creater by: DungDam
	*/
	static function select($value){
		
		$doc = new DOMDocument();
		$doc->load(FILE_PATH . '/xml/'. $value . '.xml');
		
		$arrXml 	= array();
		$xml 		= $doc->getElementsByTagName($value);
		
		foreach($xml as $v){
			
			$ids 	= $v->getElementsByTagName('id');
			$id 	= $ids->item(0)->nodeValue;
		
			$names	= $v->getElementsByTagName('name');
			$name	= $names->item(0)->nodeValue;
			
			$arrXml[$id] = $name;
		}
		return $arrXml;
	}
}
